import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/common/Login.vue')
    },
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      
      children: [
        {
          path: '/CustomEcharts',
          name: 'CustomEcharts',
          component: () => import('../views/demo/CustomEcharts.vue')
        },
        {
          path: '/CesiumVue3Demo',
          name: 'CesiumVue3Demo',
          component: () => import('../views/demo/CesiumVue3Demo.vue')
        },
        {
          path: '/about',
          name: 'about',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/AboutView.vue')
        },
        {
          path: '/error',
          name: 'error',
          component: () => import('../views/common/Error.vue')
        }
      ]
    },
  ]
})

export default router
